package com.qianf.qfoffice.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

public class Week implements Serializable {

    private int id;

    private String title;

    private String content;

    private int status;


    /*
     * @JsonFormat(pattern = "yyyy--MM-dd HH:mm:ss",timezone = "GMT+8")
     * 将json中的将 转换为 java date
     * 返回json数据可以将date转为yyyy--MM-dd HH:mm:ss
     * */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    /*
     * @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     * 接收对象时 将属性 yyyy-MM-dd HH:mm:ss -----> date
     * */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    private String uno;

    public Week() {
    }

    public Week(int id, String title, String content, int status, Date createTime, String uno) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.status = status;
        this.createTime = createTime;
        this.uno = uno;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getCreateTime() {

        this.createTime = new Date();

        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUno() {
        return uno;
    }

    public void setUno(String uno) {
        this.uno = uno;
    }

    @Override
    public String toString() {
        return "Week{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", status=" + status +
                ", createTime=" + createTime +
                ", uno='" + uno + '\'' +
                '}';
    }
}
